<template>
  <transition name="lc" ref="myTran">
    <div class="innerCom" v-show="isShow" @mouseenter="inner" @mouseleave="leave">
      <div class="leftCom">
        <div class="contentLeft">
          <div class="name">
            {{ receiveVal.name }}
          </div>
          <div class="word">
            {{ receiveVal.content }}
          </div>
          <div class="go">
            前往{{ receiveVal.name }}
          </div>
        </div>
      </div>
      <div class="minCom">
        <div class="sonMin">
          <div class="sonTitle" v-for="(item,index) in receiveVal.arrList" :key="index">
            <div style="font-size: 14px; font-weight: 600;">{{ item.name }}</div>
            <div class="innerdiv" v-for="(items,indexs) in item.sonList" :key="indexs">
              {{ items }}
            </div>
          </div>
        </div>
      </div>
      <div class="rightCom">
        <div class="rightSon">
          <div class="mySon" v-for="(item,index) in receiveVal.lastArr" :key="index">
            <div class="title">
              {{ item.name }}
            </div>
            <div class="content">
              {{ item.content }}
            </div>
          </div>
        </div>
      </div>
    </div>
  </transition>
</template>
<script setup>
import { ref, toRefs, defineProps, defineEmits, watch, getCurrentInstance } from 'vue'

// 获取页面Dom
// const myTran = ref(null)
// const dom = getCurrentInstance()
// trans.value = dom.ctx.$refs.myTran()

// props
const props = defineProps({
  isShow: Boolean,
  ObjConet: Object
})
const { isShow, ObjConet } = toRefs(props)
const receiveVal = ref({})
watch(props.ObjConet, (newValue, oldValue) => {
  receiveVal.value = newValue.value
})
// emit
const emit = defineEmits(['inner', 'leave'])
const inner = () => {
  emit('inner')
}
const leave = () => {
  emit('leave')
}

</script>
<style lang="scss" scoped>
.innerCom {
  position: absolute;
  top: 116px;
  box-shadow: 0px 4px 9px #30353f inset !important;
  width: 100%;
  height: calc(100vh - 116px);
  background-color: #D3BABA;
  display: flex;
  .leftCom {
    width: 15%;
    box-shadow: 0px 4px 9px #30353f inset !important;
    background-color: #f7f3f3;
    .contentLeft {
      width: 80%;
      margin: 0 auto;
      padding-top: 30px;
      // .name {}
      .word {
        margin-top: 10px;
      }
      .go {
        color: #0052d9;
        margin-top: 10px;
      }
    }
  }
  .minCom {
    width: 60%;
    padding: 0 20px;
    .sonMin {
      margin: 0 auto;
      padding-top: 30px;
      display: flex;
      .sonTitle {
        padding: 20px;
        width: 10%;
        .innerdiv {
          margin: 10px 0;
        }
      }
    }
  }
  .rightCom {
    box-shadow: 0px 4px 9px #30353f inset !important;
    width: 25%;
    background-color: #f7f3f3;
    .rightSon {
      width: 80%;
      padding-top: 30px;
      margin: 0 auto;
      .mySon {
        width: 100%;
        padding: 8px;
        height: 50px;
        margin: 15px 0;
        background-color: #fff;
        box-shadow: 0px 4px 9px #30353f;
        border-radius: 10px;
        .title {
          font-size: 16px;
          font-weight: 600;
        }
        .content {
          margin-top: 15px;
          width: 200px; /* 容器宽度 */
          white-space: nowrap;
          overflow: hidden;
          text-overflow: ellipsis;
          font-size: 12px;
        }
      }
    }
  }
}
 .lc-enter-from,.lc-leave-to {//进入前，离开后
      height: 0;
  }
  .lc-enter-active {
      transition: all .3s;
  }
</style>
